package com.example.demo_actionbar_tab;


import java.util.ArrayList;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.GridView;

public class Danhsach extends Fragment {

	private ArrayList<Truyen> data=new ArrayList<Truyen>();
	private GridView grid;
		
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		View rootView=inflater.inflate(R.layout.activity_danhsach, container,false);
		grid = (GridView) rootView.findViewById(R.id.grd_ds);
		data.add(new Truyen(R.drawable.ic_launcher,"Truyen 1"));
		data.add(new Truyen(R.drawable.ic_launcher,"Truyen 2"));
		data.add(new Truyen(R.drawable.ic_launcher,"Truyen 3"));
		data.add(new Truyen(R.drawable.ic_launcher,"Truyen 4"));
		data.add(new Truyen(R.drawable.ic_launcher,"Truyen 5"));
		adapter_grid adapter = new adapter_grid(getActivity(), R.layout.row_grid, data);
		//adapter_grid adapter = new adapter_grid(getActivity(), R.layout.row_grid, data);
		grid.setAdapter(adapter);
		return rootView;
		
	}
}
